package componentes;
import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuBar;

/**
 * @author Reynald0
 */
public class CompMenu extends JMenu
{
   public CompMenu(JMenuBar pMenuBar)
   {
      this(pMenuBar,"Nuevo Menu");
   }
   
   public CompMenu(JMenuBar pMenuBar,String pNombre)
   {
      this (pMenuBar, pNombre, "");
   }
   
   public CompMenu(JMenuBar pMenuBar, String pNombre, String pRutaImagen)
   {
      setText(pNombre);
      pMenuBar.add(this);
      setAlignmentX(CENTER_ALIGNMENT);
      
      if (pRutaImagen != null || pRutaImagen != "")
         setIcon(new ImageIcon(pRutaImagen));
   }
   
   public CompMenu(JMenu pMenu,String pNombre)
   {
      setText(pNombre);
      pMenu.add(this);
      setAlignmentX(CENTER_ALIGNMENT);
   }
   
   
}
